@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">注册</div>
                <div class="panel-body">
                    <form class="form-horizontal" role="form" method="POST" action="{{ url('/register') }}">
                        {{ csrf_field() }}
						
						
                        <div class="form-group{{ $errors->has('name') ? ' has-error' : '' }}">
                            <label for="name" class="col-md-4 control-label sr-only">用户名</label>

                            <div class="col-md-6">
                                <input id="name" type="text" class="form-control" placeholder="用户名" name="name" value="{{ old('name') }}" required autofocus>

                                @if ($errors->has('name'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('name') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
	
						<div class="form-group{{ $errors->has('mobile') ? ' has-error' : '' }}">
                            <label for="mobile" class="col-md-4 control-label sr-only">手机号码</label>

                            <div class="col-md-6">
                                <input id="mobile" type="tel" class="form-control" placeholder="手机号码" name="mobile" value="{{ old('mobile') }}" required>

                                @if ($errors->has('mobile'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('mobile') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>
						
						<div class="form-group{{ $errors->has('verifyCode') ? ' has-error' : '' }}">
                            <label for="verifyCode" class="col-md-4 control-label sr-only">验证码</label>

                            <div class="col-md-6">
								<div class="input-group" style="width:100%">
                                <input id="verifyCode" type="verifyCode" placeholder="验证码" class="form-control col-md-10" style="width:60%;" name="verifyCode" value="{{ old('verifyCode') }}" required>
								<button type="button"  id="sendVerifySmsButton" class=" btn btn-info form-control" style="width:40%;background:#3097D1;" >获取验证码</button>
								</div>
								@if ($errors->has('verifyCode'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('verifyCode') }}</strong>
                                    </span>
                                @endif
							</div>
						</div>
						


						<!--	
                        <div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
                            <label for="email" class="col-md-4 control-label">E-Mail Address</label>

                            <div class="col-md-6">
                                <input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}" required>

                                @if ($errors->has('email'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('email') }}</strong>
                                        </span>
                                @endif
                            </div>
						</div>
						-->
						<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
							<label for="password" class="col-md-4 control-label sr-only">密码</label>

							<div class="col-md-6">
								<input id="password" type="password" placeholder="密码" class="form-control" name="password" required>

								@if ($errors->has('password'))
									<span class="help-block">
                                        <strong>{{ $errors->first('password') }}</strong>
                                    </span>
                                @endif
                            </div>
                        </div>

                        <div class="form-group">
                            <label for="password-confirm" class="col-md-4 control-label sr-only">确认密码</label>

                            <div class="col-md-6">
                                <input id="password-confirm" type="password" placeholder="确认密码" class="form-control" name="password_confirmation" required>
                            </div>
                        </div>
                        
                        <div class="form-group{{ $errors->has('luotest_response') ? ' has-error' : '' }}">
                            <!-- <label for="password-confirm" class="col-md-4 control-label">人机验证</label> -->

                            <div class="col-md-6">
                                <div class="l-captcha" data-site-key="7c0aab865141ce6f89cf3f9a5431f42f"></div>
                                @if ($errors->has('luotest_response'))
                                    <span class="help-block">
                                        <strong>{{ $errors->first('luotest_response') }}</strong>
                                    </span>
                                @endif
                            </div>
                            
                        </div>

                        <script src="//captcha.luosimao.com/static/dist/api.js"></script>

                        <div class="form-group">
                            <div class="col-md-6 col-md-offset-4">
                                <button type="submit" class="btn btn-primary btn-block">
                                    注册
                                </button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
	
</div>
<!-- 模态框（Modal） -->
<div class="modal fade" id="myModal" tabindex="-1"  role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                
            </div>
            <div class="modal-body"></div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal -->
</div>
@endsection
@section('js')
<script src="{{ asset('js/laravel-sms.js') }}"></script>
<script>
$('#sendVerifySmsButton').sms({
	//laravel csrf token
	token       : "{{csrf_token()}}",
	//请求间隔时间
	interval    : 60,
	//请求参数
	requestData : {
		//手机号
		mobile : function () {
			return $('input[name=mobile]').val();
		},
		//手机号的检测规则
		mobile_rule : 'mobile_required'
	}
});
</script>

@endsection
